home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / piacquire.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-14  |  7.8 KB  |  215 lines

  1. /*
  2.     File: PIAcquire.h
  3.  
  4.     Copyright (c) 1990-1, Thomas Knoll.
  5.     Copyright (c) 1992-6, Adobe Systems Incorporated.
  6.     All rights reserved.
  7.  
  8.     This file describes version 4.0 of Photoshop's Acquisition module interface.
  9. */
  10.  
  11. #ifndef __PIAcquire__
  12. #define __PIAcquire__
  13.  
  14. #include "PIActions.h"
  15. #include "PIGeneral.h"
  16.  
  17. /* Operation selectors */
  18.  
  19. #define acquireSelectorAbout    0
  20. #define acquireSelectorStart    1
  21. #define acquireSelectorContinue 2
  22. #define acquireSelectorFinish    3
  23. #define acquireSelectorPrepare    4
  24. #define acquireSelectorFinalize 5
  25.  
  26. /*    Error return values. The plug-in module may also return standard Macintosh
  27.     operating system error codes, or report its own errors, in which case it
  28.     can return any positive integer. */
  29.  
  30. #define acquireBadParameters    -30000    /* "a problem with the acquisition module interface" */
  31. #define acquireNoScanner        -30001    /* "there is no scanner installed" */
  32. #define acquireScannerProblem    -30002    /* "a problem with the scanner" */
  33.  
  34. /******************************************************************************/
  35. /* Pragma to byte align structures; only for Borland C */
  36.  
  37. #if defined(__BORLANDC__)
  38. #pragma option -a-
  39. #endif
  40.  
  41. /******************************************************************************/
  42.  
  43. #if PRAGMA_ALIGN_SUPPORTED
  44. #pragma options align=mac68k
  45. #endif
  46.  
  47. typedef struct AcquireRecord
  48.     {
  49.  
  50.     int32            serialNumber;    /* Host's serial number, to allow
  51.                                        copy protected plug-in modules. */
  52.  
  53.     TestAbortProc    abortProc;        /* The plug-in module may call this no-argument
  54.                                        Boolean function (using Pascal calling
  55.                                        conventions) several times a second during long
  56.                                        operations to allow the user to abort the operation.
  57.                                        If it returns TRUE, the operation should be aborted
  58.                                        (and a positive error code returned). */
  59.  
  60.     ProgressProc    progressProc;    /* The plug-in module may call this two-argument
  61.                                        procedure periodically to update a progress
  62.                                        indicator.  The first parameter is the number
  63.                                        of operations completed; the second is the total
  64.                                        number of operations. */
  65.  
  66.     int32            maxData;        /* Maximum number of bytes that should be
  67.                                        passed back at once, plus the size of any
  68.                                        interal buffers. The plug-in may reduce this
  69.                                        value in the acquireSelectorPrepare routine. */
  70.  
  71.     int16            imageMode;        /* Image mode */
  72.     Point            imageSize;        /* Size of image */
  73.     int16            depth;            /* Bits per sample, currently must be 1 or 8 */
  74.     int16            planes;         /* Samples per pixel */
  75.  
  76.     Fixed            imageHRes;        /* Pixels per inch */
  77.     Fixed            imageVRes;        /* Pixels per inch */
  78.  
  79.     LookUpTable        redLUT;         /* Red LUT, only used for Indexed Color images */
  80.     LookUpTable        greenLUT;        /* Green LUT, only used for Indexed Color images */
  81.     LookUpTable        blueLUT;        /* Blue LUT, only used for Indexed Color images */
  82.  
  83.     void *            data;            /* A pointer to the returned image data. The
  84.                                        plug-in module is now responsible for freeing
  85.                                        this buffer (this is a change from previous
  86.                                        versions). Should be set to NIL when
  87.                                        all the image data has been returned. */
  88.  
  89.     Rect            theRect;        /* Rectangle being returned */
  90.     int16            loPlane;        /* First plane being returned */
  91.     int16            hiPlane;        /* Last plane being returned */
  92.     int16            colBytes;        /* Spacing between columns */
  93.     int32            rowBytes;        /* Spacing between rows */
  94.     int32            planeBytes;     /* Spacing between planes (ignored if only one
  95.                                        plane is returned at a time) */
  96.  
  97.     Str255             filename;        /* Document file name */
  98.     int16            vRefNum;        /* Volume reference number, or zero if none */
  99.     Boolean         dirty;            /* Changes since last saved flag. The plug-in may clear
  100.                                        this field to prevent prompting the user when
  101.                                        closing the document. */
  102.  
  103.     OSType            hostSig;        /* Creator code for host application */
  104.     HostProc        hostProc;        /* Host specific callback procedure */
  105.  
  106.     int32            hostModes;        /* Used by the host to inform the plug-in which
  107.                                        imageMode values it supports.  If the corresponding
  108.                                        bit (LSB = bit 0) is 1, the mode is supported. */
  109.  
  110.     PlaneMap        planeMap;        /* Maps plug-in plane numbers to host plane
  111.                                        numbers.  The host initializes this is a linear
  112.                                        mapping.  The plug-in may change this mapping if
  113.                                        it sees the data in a different order. */
  114.  
  115.     Boolean         canTranspose;    /* Is the host able to transpose the image? */
  116.     Boolean         needTranspose;    /* Does the plug-in need the image transposed? */
  117.  
  118.     Handle            duotoneInfo;    /* Handle to duotone information, if returning a
  119.                                        duotone mode image.    The plug-in is responsible
  120.                                        for freeing this buffer. */
  121.  
  122.     int32            diskSpace;        /* Free disk space on the host's scratch disk or
  123.                                        disks.  Set to a negative number if host does
  124.                                        not use a scratch disk. */
  125.  
  126.     SpaceProc        spaceProc;        /* If not NIL, a pointer to a no-argument
  127.                                        in32 valued function (using Pascal calling
  128.                                        conventions) which uses the current settings of
  129.                                        the imageMode, imageSize, depth, and planes
  130.                                        fields to compute the amount of scratch disk
  131.                                        space required to hold the image.  Returns -1
  132.                                        if the settings are not valid. */
  133.  
  134.     PlugInMonitor    monitor;        /* Information on current monitor */
  135.  
  136.     void *            platformData;    /* Platform specific information. */
  137.  
  138.     BufferProcs *    bufferProcs;    /* The buffer procedures.          */
  139.     
  140.     ResourceProcs *    resourceProcs;    /* The plug-in resource procedures. */
  141.     
  142.     ProcessEventProc processEvent;    /* Pass events to the application. */
  143.  
  144.     Boolean         canReadBack;    /* Can we return data for filtering? */
  145.  
  146.     Boolean         wantReadBack;    /* Does the plug-in want to read the data back? */
  147.  
  148.     Boolean         acquireAgain;    /* If true at finish, call the plug-in again.
  149.                                        Not all hosts may pay attention to this flag. */
  150.  
  151.     Boolean         canFinalize;    /* Can the host make the finalize call? */
  152.     
  153.     DisplayPixelsProc displayPixels;/* Display dithered pixels. */
  154.     
  155.     HandleProcs        *handleProcs;    /* Platform independent handle manipulation. */
  156.     
  157.     /* New in 3.0. */
  158.     
  159.     Boolean            wantFinalize;    /* Requests an acquireSelectorFinalize call
  160.                                        if the host provides the newer protocol
  161.                                        (canFinalize). */
  162.  
  163.     char            reserved1[3];    /* Get us aligned to a four byte */
  164.                                     /* boundary. */
  165.  
  166.     ColorServicesProc colorServices; /* Routine to access color services. */
  167.     
  168.     AdvanceStateProc advanceState;    /* Advance state.  Valid to call only
  169.                                        within an acquireSelectorContinue
  170.                                        call. */
  171.  
  172.     /* New in 3.0.4. */
  173.     
  174.     ImageServicesProcs *imageServicesProcs;
  175.                                     /* The suite of image processing services
  176.                                        callbacks. */
  177.     
  178.     int16            tileWidth;        /* The width of the tiles. Zero if not set. */
  179.     int16            tileHeight;        /* The height of the tiles. Zero if not set. */
  180.     
  181.     Point            tileOrigin;        /* The origin point for the tiles. */
  182.  
  183.     PropertyProcs    *propertyProcs;    /*    Routines to query and set document and
  184.                                         view properties. The plug-in needs to
  185.                                         dispose of the handle returned for
  186.                                         complex properties (the plug-in also
  187.                                         maintains ownership of handles for
  188.                                         set properties.
  189.                                     */
  190.     
  191.     /* New in 4.0 */
  192.     
  193.     PIDescriptorParameters    *descriptorParameters;    /* For recording and playback */
  194.     Str255                    *errorString;            /* For silent and errReportString */
  195.  
  196.     char            reserved [192]; /* Set to zero */
  197.  
  198.     }
  199. AcquireRecord, *AcquireRecordPtr;
  200.  
  201. #if PRAGMA_ALIGN_SUPPORTED
  202. #pragma options align=reset
  203. #endif
  204.  
  205. /******************************************************************************/
  206. /* turn off the byte align pragma back to its original state; only for Borland C */
  207.  
  208. #if defined(__BORLANDC__)
  209. #pragma option -a.
  210. #endif
  211.  
  212. /******************************************************************************/
  213.  
  214. #endif
  215.